home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 12
/
CU Amiga Magazine's Super CD-ROM 12 (1997)(EMAP Images)(GB)[!][issue 1997-07].iso
/
CUCD
/
Games
/
DestructivePoker
/
sources
/
sources.lha
/
POKER.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-13
|
3KB
|
128 lines
/*
poker.cpp (windows pääohjelma moduuli)
V1.00 - 031196 Kimmo Teräväinen
----- ------ ----------------
V0.01 031196 Taken laskuri.cpp by Vesa Lappalaine and edited
V0.10 291196 it a lot.
PROJECT: (Windows)
POKER.CPP
POKER.RC
GAME.CPP
IMAGE.CPP
CARD.CPP
CARDPILE.CPP
HANDPILE.CPP
HANDPRFS.CPP
DEALPILE.CPP
BETPREFS.CPP
DOUBLE.CPP
SAVEFILE.CPP
*/
#include <owl/owlpch.h>
#include <owl/profile.h>
#include "poker.rh"
#include "game.h"
#define INIFILE "poker.ini"
//---------------------------------------------------------------------------
class TPokerDialog : public TDialog {
cGamePoker *game;
TBitmap *cardgfx;
public:
TPokerDialog(TWindow *parent, TResId resId, TModule *module = 0) :
TDialog(parent,resId,module)
{}
void SetupWindow() {
const TModule &module(*this->GetModule());
cardgfx=new TBitmap(module,CARDGFX);
game=new cGamePoker(this,cardgfx);
// this->CreateChildren();
}
virtual ~TPokerDialog() {
if(game) delete game; game=NULL;
if(cardgfx) delete cardgfx; cardgfx=NULL;
}
void CmMenuQuit() {
Destroy();
}
void CmMenuNew() { game->MenuNew(); }
void CmMenuOld() { game->MenuOld(); }
void CmMenuSave() { game->MenuSave(); }
void CmMenuAbout() { game->MenuAbout(); }
// void CmMenuEditCopy() { game->MenuCopy(); }
void CmMenuPrefsBet() { game->MenuPrefsBet(); }
void CmMenuPrefsHand() { game->MenuPrefsHand(); }
void CmMenuHelp() { game->MenuHelp(); }
void BnCard0() { game->GadgetTurn(0); }
void BnCard1() { game->GadgetTurn(1); }
void BnCard2() { game->GadgetTurn(2); }
void BnCard3() { game->GadgetTurn(3); }
void BnCard4() { game->GadgetTurn(4); }
void BnBet() { game->GadgetBet(); }
void BnShuffle() { game->GadgetShuffle(); }
void BnFinish() { game->GadgetFinish(); }
DECLARE_RESPONSE_TABLE(TPokerDialog);
};
DEFINE_RESPONSE_TABLE1(TPokerDialog, TDialog)
EV_BN_CLICKED(BUTTON_BET,BnBet),
EV_BN_CLICKED(BUTTON_SHUFFLE, BnShuffle),
EV_BN_CLICKED(BUTTON_FINISH, BnFinish),
EV_BN_CLICKED(BUTTON_CARD0, BnCard0),
EV_BN_CLICKED(BUTTON_CARD1, BnCard1),
EV_BN_CLICKED(BUTTON_CARD2, BnCard2),
EV_BN_CLICKED(BUTTON_CARD3, BnCard3),
EV_BN_CLICKED(BUTTON_CARD4, BnCard4),
EV_BN_CLICKED(IDCANCEL , CmMenuQuit),
EV_BN_CLICKED(IDOK , BnFinish),
EV_COMMAND(MENU_NEW, CmMenuNew),
EV_COMMAND(MENU_OLD, CmMenuOld),
EV_COMMAND(MENU_SAVE, CmMenuSave),
EV_COMMAND(MENU_ABOUT, CmMenuAbout),
EV_COMMAND(MENU_QUIT, CmMenuQuit),
// EV_COMMAND(MENU_EDITCOPY, CmMenuEditCopy),
EV_COMMAND(MENU_PREFSBET,CmMenuPrefsBet),
EV_COMMAND(MENU_PREFSHAND,CmMenuPrefsHand),
EV_COMMAND(MENU_HELPHELP,CmMenuHelp),
EV_COMMAND(MENU_HELPABOUT, CmMenuAbout),
END_RESPONSE_TABLE;
//---------------------------------------------------------------------------
class TPokerApp : public TApplication
{
public:
TPokerApp(const char *title) : TApplication(title) {}
void InitMainWindow() {
TDecoratedFrame *fw=new TDecoratedFrame(0,Name,
new TPokerDialog(0,DIALOG_POKER));
fw->SetFlag(wfShrinkToClient);
fw->AssignMenu(MENU_POKER);
// fw->SetIcon(this, ICON_POKERICON);
// fw->SetIconSm(this, ICON_POKERICON);
SetMainWindow(fw);
}
};
/********************* Pääohjelma ******************************************/
int OwlMain(int ,char far * [])
{
return TPokerApp("Poker").Run();
}